#include"Shm.hpp"
#include"Fifo.hpp"

int main()
{
   FileOper writerfile(PATH, FILENAME);
   writerfile.OpenForWrite();
   
   //客户端获取共享内存
   Shm shm(pathname, projid, USER);
   char* mem = (char*)shm.VirtualAddr();

   int index = 0;
   for(char c = 'A'; c <= 'B'; index += 2)
   {
       //向共享内存写入
       sleep(1);
       mem[index] = c;
       mem[index + 1] = c;
       sleep(1);
       mem[index + 2] = '\0';
       
       //唤醒
       writerfile.WakeUp();
   }
  
   writerfile.Close();
    return 0;
}